package ImmovableIndia;

import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import InvestmentPojo.ArticlesDataPojo;
import InvestmentPojo.DefinitionsPojo;
import InvestmentPojo.FormsNCheckListsPojo;
import InvestmentPojo.MasterCircularsPojo;
import InvestmentPojo.PressNotesPojo;
import InvestmentPojo.circularsPojo;
import InvestmentPojo.faqPojo;
import Notifications.notificationTablePojo;
import Notifications.notificationsDataLoading;

public class serviceManagerImpl {
	
	long days=0;
	String image="";
	Calendar cal = Calendar.getInstance();
	public long calculateDays(Date dateEarly, Date dateLater) {  
		   return (dateLater.getTime() - dateEarly.getTime()) / (24 * 60 * 60 * 1000);  
		} //returns the days.
	public String getNotificationData(String serviceId,String tableName,String userName) {
	
		
		
		
		  StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  List li = null;
		try{
			 sb = new StringBuffer();
			 ndb = new notificationsDataLoading();
			 String DATE_FORMAT_NOW = "yyyyMMdd";
			  SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
			  
			  if("4".equals(serviceId)){
				  
					 String typeArray[] = {"Rupee","Deposits"};
					  for(int k=0;k<typeArray.length;k++){
						  li = ndb.getNotificationObject(serviceId, serviceId,tableName);
							
						  
						  sb.append("<table width='100%' align='center' border='0'  class='TBFORM' cellspacing ='0' cellpadding='3' valign='center'>");
						  sb.append("<tr align='center' class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>NOTIFICATIONS");
						  if(k==1){
							  sb.append(" - Deposits");
						  }else{
							  sb.append(" - Rupee");
						  }
						  sb.append("</b></font></TD></TR>");
						  sb.append("<tr><td class='THFont' width='5%'>Sr No</td><td class='THFont' width ='10%'>Notification Number</td><td class='THFont' width ='10%'>Date of Notification</td><td class='THFont' width='60%'>Summary</td><td class='THFont' width='10%'>Effective date</td></tr>");
						  if(li.isEmpty()){
							  sb.append("<tr><td width='90%' colspan='5' class='PH1' align='center'>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</td></tr>");
						  }
						  sb.append("<tr><td colspan='5'>");
						  if(li.size() > 5){
							  sb.append("<table width='100%' style='height: 300px; overflow-y: auto; display: block;'>");
							  }else{
							  sb.append("<table width='100%'>");}
						  if(null != li){
							  for(int i=0;i<li.size();i++){
								  notificationTablePojo obj = (notificationTablePojo)li.get(i);
								  Date dateNow = new Date(obj.getDateofNotification());
								  days=calculateDays(dateNow,cal.getTime());
								  if(days <= 129){
										image="<img alt='*' src='images/new.gif'/>";
								  }else {image="";}
								  int j=i+1;
								  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='5%' class='PH1'>"+j+"</td><td width ='10%' class='PH1'><a style='color: blue; text-decoration: none; border-bottom: 1px solid green;'; href='http://www.investmentgateways.com/NOTIFICATIONS/");
								  sb.append(sdf.format(dateNow)+" NOT "+obj.getNotificationNo()+".pdf' target='_blank'>");
								  
								  sb.append(obj.getNotificationNo()+"</a>"+image+"</td><td width='10%' class='PH1'><font class='textFont' !important;>"+obj.getDateofNotification()+"</font></td><td width='60%' class='PH1'><font class='textFont' !important;>"+obj.getSubjectMatter()+"</font></td><td width='10%' class='PH1'><font class='textFont' !important;>"+obj.getEffectiveDate()+"</font></td></tr>");
						            sb.append("</tr>");
							  }
							  sb.append("</table></td></tr>");
							  sb.append("</table>");
						  }
						 sb.append("<br><br>"); 
						  
						  
					  }
					  
			}else{
				li = ndb.getNotificationObject(serviceId, serviceId,tableName);
			
		  
		  sb.append("<table width='100%' align='center' border='0'  class='TBFORM' cellspacing ='0' cellpadding='3' valign='center'>");
		  sb.append("<tr align='center' class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>NOTIFICATIONS</b></font></TD></TR>");
		  sb.append("<tr><td class='THFont' width='5%'>Sr No</td><td class='THFont' width ='15%'>Notification Number</td><td class='THFont' width ='10%'>Date of Notification</td><td class='THFont' width='60%'>Summary</td><td class='THFont' width='10%'>Effective date</td></tr>");
		  if(li.isEmpty()){
			  sb.append("<tr><td width='100%' colspan='5' class='PH1' align='center'>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</td></tr>");
		  }
		  sb.append("<tr><td colspan='5'>");
		  if(li.size() > 10){
			  sb.append("<table width='100%' style='height: 600px; overflow-y: auto; display: block;'>");
			  }else{
			  sb.append("<table width='100%'>");}
		  if(null != li){
			  for(int i=0;i<li.size();i++){
				  notificationTablePojo obj = (notificationTablePojo)li.get(i);
				  Date dateNow = new Date(obj.getDateofNotification());
				  days=calculateDays(dateNow,cal.getTime());
				  if(days <= 129){
						image="<img alt='*' src='images/new.gif'/>";
				  }else {image="";}
				  int j=i+1;
				  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='5%' class='PH1'>"+j+"</td><td width ='10%' class='PH1'><a style='color: blue; text-decoration: none; border-bottom: 1px solid green;'; href='http://www.investmentgateways.com/NOTIFICATIONS/");
				  sb.append(sdf.format(dateNow)+" NOT "+obj.getNotificationNo()+".pdf' target='_blank'>");
				  
				  sb.append(obj.getNotificationNo()+"</a>"+image+"</td><td width='10%' class='PH1'><font class='textFont' !important;>"+obj.getDateofNotification()+"</font></td><td width='60%' class='PH1'><font class='textFont' !important;>"+obj.getSubjectMatter()+"</font></td><td width='10%' class='PH1'><font class='textFont' !important;>"+obj.getEffectiveDate()+"</font></td></tr>");
		            sb.append("</tr>");
			  }
			  sb.append("</table></td></tr>");
			  sb.append("</table>");
		  }
		  
		  }
			  sb.append("</table>");
		
		  str123 = sb.toString();
		}catch(Exception e){
			e.printStackTrace();
		}
		 
		return str123;
	  
	}
	
	public String getArticlesData(String serviceId,String tableName,String userName){
		
		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		try{
			 ndb = new notificationsDataLoading();
			 sb = new StringBuffer();
			 String DATE_FORMAT_NOW = "yyyyMMdd";
			  SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
			  List li = ndb.getArticlesObject(serviceId,"articles", "1");
			  sb.append("<table width='100%' align='center' border='0' style='float:center !important;' class='TBFORM' cellspacing ='0' cellpadding='3' align='center !important'>");
			  sb.append("<tr align='center' class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>ARTICALS</b></font></TD></TR>");
			  sb.append("<tr><td width ='5%'class='THFont'>Sr No</td><td class='THFont'>Summary</td><td width='20%' class='THFont'>Date Of Article</td><td width='20%' class='THFont'>Author</td></tr>");
			  if(null != li){
				  for(int i=0;i<li.size();i++){
					  ArticlesDataPojo obj = (ArticlesDataPojo)li.get(i);
					  Date dateNow = new Date(obj.getDateofArticle());
					  int j=i+1;
					  
					  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width ='5%' class='PH1'>"+j+"</td><td class='PH1'><a style='color: blue; text-decoration: none; border-bottom: 1px solid green;'; href='http://www.investmentgateways.com/PRESSNOTES/"+sdf.format(dateNow)+" ARTI "+obj.getTopic()+".doc' target='_blank'>"+obj.getArticalSubjectMatter());
					  sb.append("</td><td class='PH1'><font class='textFont' !important;>"+obj.getDateofArticle()+"</font></td><td class='PH1'><font class='textFont' !important;>"+obj.getCreatedBy()+"</font></td>");
			            sb.append("</tr>");
				  }if(li.isEmpty()){
					  sb.append("<tr><td width='90%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>");
				  }
				  sb.append("</table>");
			  }else{
				  sb.append("</table>");
			  }
		
			   
			  returnString = sb.toString();
			
		}catch(Exception e){
			e.printStackTrace();
		}
		return returnString;
		
	}
	
	public String getCircularsData(String serviceId,String tableName,String method){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  ndb = new notificationsDataLoading();
		  String DATE_FORMAT_NOW = "yyyyMMdd";
		  SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
		  		 li = ndb.getCircularsObject(serviceId, tableName,"1");
		  		 
		  sb.append("<table width='100%' align='center' border='0' style='float:center !important;' class='TBFORM' cellspacing ='0' cellpadding='0' valign='center'>");
		  sb.append("<tr align='center' class ='TITLEFORM'><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>CIRCULARS</b></font></TD></TR>");
		 
		  sb.append("<tr><td class='THFont' width='5%'>Sr No</td><td class='THFont' width='10%'>Circular No</td><td class='THFont' width='18%'>Date of Circular</td><td class='THFont' width='67%'>Summary</td></tr>");
		  if(li.isEmpty()){
			  sb.append("<tr><td width='100%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>");
		  }
		  sb.append("<tr><td colspan='5'>");
		  if(li.size() > 10){
			  sb.append("<table width='100%' style='height: 600px; overflow-y: auto; display: block;'>");
			  }else{
			  sb.append("<table width='100%'>");}
		  if(null != li){
		  for(int i=0;i<li.size();i++){
			  circularsPojo obj = (circularsPojo)li.get(i);
			  Date dateNow = new Date(obj.getCreatedDate());
			  days=calculateDays(dateNow,cal.getTime());
			  if(days <= 129){
					image="<img alt='*' src='images/new.gif'/>";
			  }else {image="";}
			  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='5%' class='PH1'><font class='textFont'!important;>"+(i+1)+"</font></td><td width ='10%' class='PH1'><a style='color: blue; text-decoration: none; border-bottom: 1px solid green;'; href='http://www.investmentgateways.com/CIRCULARS/"+sdf.format(dateNow)+" CIR "+obj.getTopic()+".pdf' target='_blank'>");
			  sb.append(obj.getTopic()+"</a>"+image+"</td><td width='18%' class='PH1'><font class='textFont' !important;>"+obj.getCreatedDate()+"</font></td><td width='67%' class='PH1'><font class='textFont' !important;>"+obj.getCircular_subject()+"</font></td></tr>");
		  }
		  }
		  sb.append("</table></td></tr>");
		  sb.append("</table>");
		  
		  returnString = sb.toString();
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	public String getsMasterCircularsData(String serviceId,String tableName,String method){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  ndb = new notificationsDataLoading();
		  String DATE_FORMAT_NOW = "yyyyMMdd";
		  SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
		  		 li = ndb.getCircularsObject(serviceId, tableName,"1");
		  		 
		  sb.append("<table width='100%' align='center' border='0' style='float:center !important;' class='TBFORM' cellspacing ='0' cellpadding='0' valign='center'>");
		  sb.append("<tr align='center' class ='TITLEFORM'><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>MASTER CIRCULARS</b></font></TD></TR>");
		 
		  sb.append("<tr><td width='5%' class='THFont'>Sr No</td><td width ='20%' class='THFont'>Circular No</td><td width='55%' class='THFont'>Summary</td><td width='15%' class='THFont'>Issued Date</td></tr>");
		  if(null != li){
		  for(int i=0;i<li.size();i++){
			  MasterCircularsPojo obj = (MasterCircularsPojo)li.get(i);
			  Date dateNow = new Date(obj.getIssueDate());
			  days=calculateDays(dateNow,cal.getTime());
			  if(days <= 129){
					image="<img alt='*' src='images/new.gif'/>";
			  }else {image="";}
			  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='5%' class='PH1'><font class='textFont'!important;>"+(i+1)+"</font></td><td width ='20%' class='PH1'><a style='color: blue; text-decoration: none; border-bottom: 1px solid green;'; href='http://www.investmentgateways.com/CIRCULARS/"+sdf.format(dateNow)+" MCIR "+obj.getTopic()+".pdf' target='_blank'>");
			  sb.append(obj.getTopic()+"</a>"+image+"</td><td  width='55%' class='PH1'><font class='textFont' !important;>"+obj.getExtra_column()+"</font></td><td width='15%' class='PH1'><font class='textFont' !important;>"+obj.getIssueDate()+"</font></td></tr>");
		  }
		  }if(li.isEmpty()){
			  sb.append("<tr><td width='90%' colspan='5' class='PH1' align='center'>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</td></tr>");
		  }
		  sb.append("</table>");
		  
		  returnString = sb.toString();
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	
	public String getFAQDataLoading(String serviceId,String tableName,String method){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  ndb = new notificationsDataLoading();
		  
		  		 li = ndb.getFAQDataList(serviceId, tableName,"1");
		  		 
		  sb.append("<table width='100%' align='center' border='0' style='!important;' class='TBFORM' cellspacing ='0' cellpadding='3' align='center'>");
		  sb.append("<tr align='center' class ='TITLEFORM' ><td colspan='2'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px'valign='center' color='white'><b>FAQ's</b></font></TD></TR>");
		 
		  sb.append("<tr><td width='07%' class='THFont'>Q No</td><td class='THFont' width ='93%'>Question and Answer</td></tr>");
		  if(li.isEmpty()){
			  sb.append("<tr><td width='100%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***<font class='textFont' !important;></td></tr>");
		  }
		  sb.append("<tr><td colspan='5'>");
		  if(li.size() > 10){
			  sb.append("<table width='100%' style='height: 600px; overflow-y: auto; display: block;'>");
			  }else{
			  sb.append("<table width='100%'>");}
		  if(null != li){
			  for(int i=0;i<li.size();i++){
				  int j=i+1;
				  faqPojo obj = (faqPojo)li.get(i);
				  sb.append("<tr bgcolor='#F4FFFF'><td width='07%' class='PH1'><font class='textFont' !important;>"+j+"</font></td><td width ='93%' class='PH1'><font class='textFont' !important;>"+obj.getQuestion()+"</font></td></tr>");
				  sb.append("<tr><td class='THFont'>Ans:</td><td width='93%' class='PH1'><font class='textFont' !important;>"+obj.getAnswer()+"</font></td></tr>");
			  }
		  }
		  sb.append("</table></td></tr>");
		  sb.append("</table>");
		  
		  returnString = sb.toString();
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	public String getPressNotesDataLoading(String serviceId,String tableName,String method){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  ndb = new notificationsDataLoading();
		  String DATE_FORMAT_NOW = "yyyyMMdd";
		  SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
		  		 li = ndb.getPressNotesDataLoading(serviceId, tableName,"1");
		  		 
		  sb.append("<table width='100%' align='center' border='0' class='TBFORM' cellspacing ='0' cellpadding='3' !important; align='center'>");
		  sb.append("<tr class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px' valign='center' color='white'><b>PRESS NOTES</b></font></TD></TR>");
		 
		  sb.append("<tr><td width='5%' class='THFont' width='05%'>Sr No</td><td width='10%' class='THFont'>Published</td><td class='THFont' width='15%'>Issued Date</td><td width ='58%' class='THFont'>Summary</td>");
		  if(!("1".equals(serviceId) || "2".equals(serviceId) || "7".equals(serviceId)) )
		  sb.append("<td width='12%'class='THFont'>Effective Date</td></tr>");
		  if(li.isEmpty()){
			  sb.append("<tr><td width='90%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>");
		  }
		  sb.append("<tr><td colspan='5'>");
		  if(li.size() > 10){
		  sb.append("<table width='100%' style='height: 500px; overflow-y: auto; display: block;'>");
		  }else{
		  sb.append("<table width='100%'>");}
		  if(null != li){
			  for(int i=0;i<li.size();i++){
				  PressNotesPojo obj = (PressNotesPojo)li.get(i);
				  Date dateNow = new Date(obj.getNormal_date());
				  days=calculateDays(dateNow,cal.getTime());
				  if(days <= 129){
						image="<img alt='*' src='images/new.gif'/>";
				  }else {image="";}
				  int j = i+1;
				  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='05%' class='PH1'><font class='textFont' !important;>"+j+"</font></td><td width ='10%' class='PH1'><a style='color: blue; text-decoration: none; border-bottom: 1px solid green;'; href='http://www.investmentgateways.com/PRESSNOTES/"+sdf.format(dateNow)+" NOTE "+obj.getSubject()+".pdf' target='_blank'>"+obj.getSubject()+"</a>"+image);
				  sb.append("</td><td width ='15%' class='PH1'><font class='textFont' !important;>"+obj.getNormal_date()+"</font></td><td width ='58%' class='PH1'><font class='textFont' !important;>"+obj.getNnotes()+"</font></td>");
				  if(!("1".equals(serviceId) || "2".equals(serviceId) || "7".equals(serviceId)) )
				  sb.append("<td width ='12%' class='PH1'>&nbsp;</td></tr>");
				  
			  }
			  sb.append("</table></td></tr>");
			  sb.append("</table>");
		  }else{
			  sb.append("</table>"); 
		  }
		  
		  
		  returnString = sb.toString();
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	
	public String getDefinitionsDataLoading(String serviceId,String tableName,String method){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  String name = "";
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  ndb = new notificationsDataLoading();
		  if("4".equals(serviceId)){
		  
		 String typeArray[] = {"Rupee","Deposits"};
		  for(int k=0;k<typeArray.length;k++){
		  li = ndb.getDefinitionsDataLoading(serviceId, tableName,typeArray[k]);	
		  sb.append("<table width='100%' align='center' border='0' class='TBFORM'  style='border-radius:5px' cellspacing ='0' cellpadding='3' !important; valign='center'>");
		  sb.append("<tr class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px' valign='center' color='white'><b>DEFINITIONS ");
		  
		  if(k==1){
			  sb.append("- Deposits");
		  }else{
			  sb.append("- Rupees");
		  }
		  
		  sb.append("</b></font></TD></TR><tr><td width='5%' class='THFont'>Sr No</td><td width='20%' class='THFont'>Sub Section/Rule/Regulation</td><td width='75%' class='THFont'>Definitions</td></tr>");
		  
		  if(null != li){
		  for(int i=0;i<li.size();i++){
			  DefinitionsPojo obj = (DefinitionsPojo)li.get(i);
			  name = null != obj.getDefinitionName()?obj.getDefinitionName():"";
			  int j = i+1;
			  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='5%' class='PH1'><font class='textFont' !important;>"+j+"</font></td><td width ='20%' class='PH1'><font class='textFont' !important;>"+obj.getSection_Rule()+"</font></td><td width ='75%' class='PH1'><font class='textFont' !important;>"+obj.getDefinition()+"</font></td><tr>");
		  }
		  }if(li.isEmpty()){
			  sb.append("<tr><td width='90%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>");
		  }
		  sb.append("</table>");
		  sb.append("<br><br>");
		  }
		  
		  
		 
		  
		  }else{
			  li = ndb.getDefinitionsDataLoading(serviceId, tableName,"1");	
			  sb.append("<table width='100%' align='center' border='0' class='TBFORM'  style='border-radius:5px' cellspacing ='0' cellpadding='3' !important; valign='center'>");
			  sb.append("<tr class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px' valign='center' color='white'><b>DEFINITIONS</b></font></TD></TR>");
			  sb.append("<tr><td width='5%' class='THFont'>Sr No</td><td width='20%' class='THFont'>Sub Section/Rule/Regulation</td><td width='75%' class='THFont'>Definitions</td></tr>");
			 
			  if(null != li){
			  for(int i=0;i<li.size();i++){
				  DefinitionsPojo obj = (DefinitionsPojo)li.get(i);
				  name = null != obj.getDefinitionName()?obj.getDefinitionName():"";
				  int j = i+1;
				  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='5%' class='PH1'><font class='textFont' !important;>"+j+"</font></td><td width ='20%' class='PH1'><font class='textFont' !important;>"+obj.getSection_Rule()+"</font></td><td width ='75%' class='PH1'><font class='textFont' !important;>"+obj.getDefinition()+"</font></td><tr>");
			  }
			  }if(li.isEmpty()){
				  sb.append("<tr><td width='90%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>");
			  }
			  sb.append("</table>");
			    
		  }
		  
		  returnString = sb.toString();
		  returnString = returnString.replaceAll("DEFINITIONS",name );
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	public String getFormsNCheckListsDataLoading(String serviceId,String tableName,String method){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  ndb = new notificationsDataLoading();
		  
		  		 li = ndb.getFormsNCheckListsDataLoading(serviceId, tableName,"1");
		  		 
		  sb.append("<table width='100%' align='center' border='0' class='TBFORM'  style='border-radius:5px' cellspacing ='0' cellpadding='3' !important; valign='center'>");
		  sb.append("<tr class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px' valign='center' color='white'><b>FORMS & CHECKLISTS</b></font></TD></TR>");
		  sb.append("<tr><td width='5%' class='THFont'>Sr No</td><td width='80%' class='THFont'>Forms/Checklists</td><td width='10%' class='THFont'>Downloads</td></tr>");
		  if(null != li){
		  for(int i=0;i<li.size();i++){
			  FormsNCheckListsPojo obj = (FormsNCheckListsPojo)li.get(i);
			  int j = i+1;
			  sb.append("<tr onmouseover=style.backgroundColor='#ebe7e4' onmouseout=style.backgroundColor=''><td width='5%' class='PH1'><font class='textFont' !important;>"+j+"</font></td><td width ='80%' class='PH1'><font class='textFont' !important;>"+obj.getSummary()+"</font></td><td width ='10%' class='PH1'><a href='http://www.investmentgateways.com/CHECKLISTS/"+obj.getSection_rule()+"-"+obj.getServiceNo()+".doc' target='_blank'><img alt='Download' src='images/download.png' width='30'/></a></td><tr>");
		  }
		  }if(li.isEmpty()){
			  sb.append("<tr><td width='90%' colspan='5' class='PH1' align='center'><font class='textFont' !important;>*** THERE ARE NO RECORDS AVILABLE FOR THIS SECTION ***</font></td></tr>");
		  }
		  sb.append("</table>");
		  
		  returnString = sb.toString();
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	public String getWithoutUserData(){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  		 
		  sb.append("<table width='100%' align='center' border='0' class='TBFORM'  style='border-radius:5px' cellspacing ='0' cellpadding='3' !important; valign='center'>");
		  sb.append("<tr class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px' valign='center' color='white'><b>Please Login to get this Section Details </b></font></TD></TR>");
		  sb.append("<tr><td><font class='PH1'><b>Please login or create an Account to access this section <a href='http://investmentgateways.com'>Click here </a></b></font></td><tr>");
		 
		  sb.append("</table>");
		  
		  returnString = sb.toString();
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	
	public String getCommingSoonData(){

		String returnString = null;
		StringBuffer sb = null;
		  String str123 = null;
		  notificationsDataLoading ndb = null;
		  try{
		  List li = null;
		  sb = new StringBuffer();
		  		 
		  sb.append("<table width='100%' align='center' border='0' class='TBFORM'  style='border-radius:5px' cellspacing ='0' cellpadding='3' !important; valign='center'>");
		  sb.append("<tr class ='TITLEFORM' ><td colspan='5'><font style='font-family:Verdana, Arial, Helvetica, sans-serif;font-size:18px' valign='center' color='white'><b>Page will come soon </b></font></TD></TR>");
		  sb.append("<tr><td><font class='PH1'><h1><span class='style3'>Page will come soon...</span></h1></font></td><tr>");
		 
		  sb.append("</table>");
		  
		  returnString = sb.toString();
		  }catch(Exception e){
			  e.printStackTrace();
		  }
		  
		  return returnString;
	  
	}
	public List getAdminPostQueyData(String queryId,String postedUser,String userName){
		List li = null;
		try{
			
		}catch(Exception e){
			e.printStackTrace();
		}
		return li;
	}
	public List getDropDownList(String tableName,String serviceId)throws SQLException{
		  List li = null;
		  notificationsDataLoading ndb = null;
	  try{
	  ndb = new notificationsDataLoading();
	  		 li = ndb.getDropDownList(tableName, serviceId);
	  }catch(Exception e){
		  e.printStackTrace();
	  }
	  return li;
	}
}